<?php
/**
 * 系統名稱: Lotto 系統
 * 檔案說明: 專案管理-修改
 * $Author$
 * $Id$
 *
 */
$data["Lotto_1_x"] = str_replace("\n", "", $data["Lotto_1_x"]);
$data["Lotto_2_x"] = str_replace("\n", "", $data["Lotto_2_x"]);
$data["Lotto_3_x"] = str_replace("\n", "", $data["Lotto_3_x"]);

$intLottoID = InsertSQL( $data, "bet_Lotto");
unset($data);
if($intLottoID != false){
	//更改 Lotto 分盤值
	if(!UpdateLottoOdds($_data["OddsValue"], $intLottoID))ErrMsgOutputHTML("Error", "", 1);
	//更改 Lotto 限額值
	if(!UpdateLottoLimits($intLottoID, $_data["ELimits"]))ErrMsgOutputHTML("Error", "", 1);
	//更改 Lotto 下注參數
	if(!UpdateArrayBetParam($intLottoID, $_data["arrBetParam"]))ErrMsgOutputHTML("Error", "", 1);
	//產生 Lotto Data 檔案
	if(!MakeLottoDataFile())ErrMsgOutputHTML("Error", "", 1);
	//產生 Lotto 下注參數檔案
	if(!MakeBetParamFile($intLottoID, $_data["ELimits"]))ErrMsgOutputHTML("Error", "", 1);
	@mysql_close($$_Conn);
	header("Location: ".basename($_SERVER["PHP_SELF"])."?op=List");
	exit();
}
ErrMsgOutputHTML("Error", "", 1);
?>